//
// Created by hunan on 2025/9/23.
//

#ifndef OPEN_NET_LOG_PUBLIC_MODULE_H
#define OPEN_NET_LOG_PUBLIC_MODULE_H

#include "log_description.h"
#include <string>
#include <sys/time.h>

#define LOG_FILE_MODE  LogUtilDecorator::LogDescMode::EmLogDescFile
#define LOG_PRINT_MODE LogUtilDecorator::LogDescMode::EmLogDescPrint
#define LOG_INIT_MODE(mode) LogUtilDecorator::GetInstance(mode)
#define LOG_UPDATE_MODULE(module, status) LogUtilDecorator::UpdateModuleState(module, status)

#define PUBLIC_MODULE_NAME        "public"
#define SOCKET_MODULE_NAME        "socket"
#define TIMER_MODULE_NAME         "timer"
#define PROTO_CONN_MODULE_NAME    "protocol"
#define HLS_MODULE_NAME           "hls"
#define UNIT_TEST_MODULE_NAME     "unittest"
#define FLV_MODULE_NAME           "flv"
#define STATISTIC_MODULE_NAME     "statistic"


#define LOG_PUBLIC_MODULE(...)     LogUtilDecorator::ProcessLog(PUBLIC_MODULE_NAME,     LogUtilDecorator::Line(__FILE__, __FUNCTION__, __LINE__), LogUtilDecorator::Log(__VA_ARGS__))
#define LOG_SOCKET_MODULE(...)     LogUtilDecorator::ProcessLog(SOCKET_MODULE_NAME,     LogUtilDecorator::Line(__FILE__, __FUNCTION__, __LINE__), LogUtilDecorator::Log(__VA_ARGS__))
#define LOG_TIMER_MODULE(...)      LogUtilDecorator::ProcessLog(TIMER_MODULE_NAME,      LogUtilDecorator::Line(__FILE__, __FUNCTION__, __LINE__), LogUtilDecorator::Log(__VA_ARGS__))
#define LOG_PROTO_CONN_MODULE(...) LogUtilDecorator::ProcessLog(PROTO_CONN_MODULE_NAME, LogUtilDecorator::Line(__FILE__, __FUNCTION__, __LINE__), LogUtilDecorator::Log(__VA_ARGS__))
#define LOG_HLS_MODULE(...)        LogUtilDecorator::ProcessLog(HLS_MODULE_NAME,        LogUtilDecorator::Line(__FILE__, __FUNCTION__, __LINE__), LogUtilDecorator::Log(__VA_ARGS__))
#define LOG_UNITTEST_MODULE(...)   LogUtilDecorator::ProcessLog(UNIT_TEST_MODULE_NAME,  LogUtilDecorator::Line(__FILE__, __FUNCTION__, __LINE__), LogUtilDecorator::Log(__VA_ARGS__))
#define LOG_FLV_MODULE(...)        LogUtilDecorator::ProcessLog(FLV_MODULE_NAME,        LogUtilDecorator::Line(__FILE__, __FUNCTION__, __LINE__), LogUtilDecorator::Log(__VA_ARGS__))
#define LOG_STATISTIC_MODULE(...)  LogUtilDecorator::ProcessLog(STATISTIC_MODULE_NAME,  LogUtilDecorator::Line(__FILE__, __FUNCTION__, __LINE__), LogUtilDecorator::Log(__VA_ARGS__))


#endif // OPEN_NET_LOG_PUBLIC_MODULE_H
